
import { useRouter } from 'vue-router';
import router from './index.ts'

// const router =  useRouter()
export const beforeEach = () => {
    router.beforeEach((to, from) => {
        let token = localStorage.getItem('TOKEN')
        if (to.path == '/login') {
            return
        }
        if (!token) {
            return ("/login")
        }
    })
}
export const afterEach = () => {
    router.afterEach((e) => {
        console.log('afterEach', e);
    })
}


